<template>
	<div class="home-body">
		<home-header :headerData="homeData"></home-header>
		<home-search></home-search>
		<home-content></home-content>
		<bottom-icon></bottom-icon>
	</div>
</template>

<script type="text/javascript">
import HomeHeader from './components/HomeHeader'
import HomeSearch from '@/pages/commonVue/HomeSearch'
import HomeContent from './components/HomeContent'
import BottomIcon from '@/pages/commonVue/BottomIcon'

export default {
	name:'Home',
	components:{
		HomeHeader,
		HomeSearch,
		HomeContent,
		BottomIcon
	},
	data () {
		return {
			homes:[],
			homess:[],
			homeData:{}
		}
	},
	methods: {
		getData () {
      // this.$a.get('/api/index.json')
      //   .then(this.GetHomeInfoSucc,err=>{
      //   	console.log('shibai')
      //   })
      //   
      this.$a.get(`http://localhost:8081/house/${this.$store.state.username}`).then(this.GetHomeInfoSucc,err=>{
        console.log('shibai');
         })
    },
    GetHomeInfoSucc (res) {
      console.log(res.data)
      res=res.data
       //console.log(res)
      if (res.err) {
      	alert('返回的数据有错')
      }else{
      	console.log(res.data)
        this.homeData = res.data
      }
    }
},
    mounted() {
    	this.getData();
    }
}
</script>

<style lang="stylus" scoped>
.home-body
	background:#fff
</style>